package nancal.mp.db.mongo.entity.sys

import nbcp.base.comm.StringMap
import nbcp.base.db.IdName
import nbcp.base.db.annotation.Cn
import nbcp.base.db.annotation.DbEntityGroup
import nbcp.base.model.BaseMarkEntity
import org.springframework.data.mongodb.core.mapping.Document

@Cn("Api路由定义")
@Document
@DbEntityGroup("sys")
class ApiRouterDefine : BaseMarkEntity(){
    /*
        gateway 路由方式
        - id: admin-api
          uri: http://iam-auth-backend/
          predicates:
            - Header=X-Custom-Header, .*
            - Host=dc-app
            - Path=/abc
          filters:
            - RewritePath=/abc,/open/client/dict
     */

    var sourcePath = ""
    var targetPath = ""

    /**
     * x-forwarded-host | host
     */
    var whenHost = ""

    /**
     * host: 正则表达式  且 ...
     */
    var whenHeaders = StringMap()

    var remark = ""
    var createBy = IdName()
    var updateBy = IdName()
}